giveme tmp factors, clear
giveme tmp fd_all, merge on(stkcd accper) keep(1 3)

foreach i in a b c d e {
    count if iFD_`i' == 1
    count if preFD_`i' == 1
}

outsheet using ./data/data.csv


encode indcd, gen(indid)

generate randmark = runiform()
sort preFD_a randmark
by preFD_a: generate train = _n < 0.75 * _N

logit preFD_a Size Growth Lev FCF PPE ROA ROE TobinQ Top1 Top10 Inventory InvTurnover lnBoard pctIndepen Age Big4 DUAL SOE Loss DvdPayout Quick Current ICRebitda ret annualret volatility turnover PE institute coverage brokers MV avLoss NCSKEW DUVOL KZologit SA DA REM PLDdummy ETR1 BTD RiskT avgLawTax RPTratio  if train
predict prob, pr
lroc
